package com.csun.cmny.provider.model.domain;

import com.csun.cmny.core.mybatis.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.Alias;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Alias(value = "dmcWatchData")
@Table(name = "cn_dmc_watch_data")
public class DmcWatchData implements Serializable {

    private static final long serialVersionUID = -5382556812815621878L;

    /**
     * 设备Id
     */
    @Id
    @Column(name = "device_id")
    private Long deviceId;

    /**
     * 状态, offline-离线，online-在线
     */
    private String status;

    /**
     * 佩戴状态 0-未佩戴 1-已佩戴
     */
    @Column(name = "wear_state")
    private Integer wearState;

    /**
     * 电量
     */
    private Integer power;

    /**
     * 协议版本号
     */
    private String protocol;

    /**
     * 设备 imsi
     */
    private String imsi;

    /**
     * 终端固件版本号
     */
    @Column(name = "wear_version")
    private String wearVersion;

    /**
     * gps地址
     */
    @Column(name = "gps_string")
    private String gpsString;

    /**
     * 百度gps,lat<纬度>,lng<经度>
     */
    @Column(name = "bd_gps")
    private String bdGps;

    /**
     * 基站地址
     */
    @Column(name = "cell_string")
    private String cellString;

    /**
     * wifi地址
     */
    @Column(name = "wifi_string")
    private String wifiString;

    /**
     * 定位方式 1-gps 2-基站 3-wifi
     */
    @Column(name = "lbs_type")
    private Integer lbsType;

    /**
     * 具体位置
     */
    private String location;

    /**
     * 具体位置时间
     */
    @Column(name = "location_time")
    private String locationTime;

    /**
     * 步数
     */
    private Integer step;

    /**
     * 公里数
     */
    private Float kilometer;

    /**
     * 卡路里数 体重（kg）* 距离（km）* 运动系数（k）
     */
    private Float calorie;

    /**
     * 心率数
     */
    @Column(name = "heart_rate")
    private Integer heartRate;

    /**
     * 心率时间
     */
    @Column(name = "heart_time")
    private String heartTime;

    /**
     * 睡眠开始时间 eg：201612162330
     */
    @Column(name = "sleep_start")
    private String sleepStart;

    /**
     * 睡眠结束时间 eg:201612170730
     */
    @Column(name = "sleep_end")
    private String sleepEnd;

    /**
     * 深睡时长 eg:0210
     */
    @Column(name = "sleep_deep")
    private String sleepDeep;

    /**
     * 浅睡时长 eg:0550
     */
    @Column(name = "sleep_light")
    private String sleepLight;

    /**
     * 睡眠总时长
     */
    @Column(name = "sleep_total")
    private String sleepTotal;

    /**
     * 睡眠日期
     */
    @Column(name = "sleep_date")
    private String sleepDate;

    /**
     * 是否激活 0-未激活 1-已激活
     */
    private Integer activation;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

}